import request from '@/util/request'

// 获取接口数据
var api = '/api'

//  获取数据
export function list (data) {
  return request({
    url: api + '/post/list',
    method: 'get',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    params: data
  })
}

// 删除
export function remove (data) {
  return request({
    url: api + '/post/delete',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    params: data
  })
}

// 更新
export function update (data) {
  return request({
    url: api + '/post/update',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    params: data
  })
}

// 新增
export function add (data) {
  return request({
    url: api + '/post/add',
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    params: data
  })
}
